package demo;

public class Box {
    private int product;

    public void addProduct() {
        if (product <= 20) {
            product++;
            System.out.println("生产了" + product + "号牛奶");
        } else {
            try {
                wait();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
